﻿@{
    ViewBag.Title = "InspectBreak";
    Layout = "~/Views/Shared/_Page.cshtml";
}

<h2>Inspect Break</h2>


<script src="/JsLib/zeus/other/inspect.js" type="text/javascript"></script>
<script type="text/javascript">
    function factorial(n) {
        // create a closure for this function
        var inspector = function ($) { return eval($); }
        inspect(inspector, "Entering factorial()");
        var result = 1;
        while (n > 1) {
            result = result * n;
            n--;
            inspect(inspector, "factorial() loop");
        }

        inspect(inspector, "Exiting factorial()");
        return result;
    }

    window.onload = function () {
        ZEUS.DEBUG.log(factorial(3));
    };
</script>